<template>
	<view class="u-p-10">
		<u-navbar autoBack title="收货地址" :safeAreaInsetTop="true"></u-navbar>
		<view class="item u-flex u-row-between u-p-20 u-m-b-10" v-for="(res, index) in siteList" :key="res.id" style="background-color: #f3f3f3;border-radius: 12rpx;">
			<view class=" u-flex-1 u-p-r-20">
				<view class="left u-flex">
					<u--text :text="res.name" size="18" color="#333"></u--text>
					<u--text :text="res.phone"></u--text>
					<u-tag text="默认" size="mini"> </u-tag>
				</view>
				<view class="u-p-t-20 u-p-b-20">
					<u--text type="info" text="广东省深圳市宝安区 自由路66号"></u--text>
				</view>
				
			</view>
			<view class="u-flex u-row-between" style="width: 140rpx;">
				<u-icon name="edit-pen" :size="30" color="#55aaff"></u-icon>
				<u-icon name="trash" :size="30" color="#ff0000"></u-icon>
			</view>
		</view>

		<view class="addSite">
			<u-button type="warning" icon="plus" shape="circle" text="新建收货地址" @click="toAddSite"></u-button>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				siteList: []
			};
		},
		onLoad() {
			this.getData();
		},
		methods: {
			getData() {
				this.siteList = [{
						id: 1,
						name: '游X',
						phone: '183****5523',
						tag: [{
								tagText: '默认'
							},
							{
								tagText: '家'
							}
						],
						site: '广东省深圳市宝安区 自由路66号'
					},
					{
						id: 2,
						name: '李XX',
						phone: '183****5555',
						tag: [{
							tagText: '公司'
						}],
						site: '广东省深圳市宝安区 翻身路xx号'
					},
					{
						id: 3,
						name: '王YY',
						phone: '153****5555',
						tag: [],
						site: '广东省深圳市宝安区 平安路13号'
					}
				];
			},
			toAddSite() {
				uni.$u.route('/pages/address/addSite')
			}
		}
	};
</script>

<style lang="scss" scoped>
	.addSite {
		width: 100%;
		padding: 10rpx 120rpx 20rpx;
		position: fixed;
		bottom: 0rpx;
		background-color: #fff;
	}
</style>
